package com.sr;

import com.sr.util.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * @author xiaochi
 * @date 2022/4/27 16:31
 * @desc SrApplication
 */
@MapperScan("com.sr.dao")
@SpringBootApplication
public class SrApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        builder.sources(SrApplication.class);
        return super.configure(builder);
    }

    public static void main(String[] args) {
        SpringApplication.run(SrApplication.class,args);
    }

    @Bean
    public IdWorker idWorker(){
        return new IdWorker(1,1);
    }
}
